cmake_minimum_required (VERSION 3.6)

project (networking)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

include_directories(./inc ./tools)

# 添加doxygen
find_package(Doxygen REQUIRED dot)

set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_DISABLE_INDEX NO)

doxygen_add_docs(docs tools/tools.h ./inc)


# 添加tools
add_subdirectory(tools)

# 添加并发模块
add_subdirectory(concurrent)

# 添加测试代码
add_subdirectory(test EXCLUDE_FROM_ALL)

add_executable (tcpclient src/tcpclient.c)
target_link_libraries (tcpclient tools)

add_executable (udpclient src/udpclient.c)
target_link_libraries (udpclient tools)

add_executable (tcpserver src/tcpserver.c)
target_link_libraries(tcpserver tools)

add_executable(host src/host.c)

add_executable(service src/service.c)

add_executable(echoserver src/echoserver.c)
target_link_libraries(echoserver tools)

#---->time service
add_executable(time_udp_client src/time_udp_client.c)
target_link_libraries(time_udp_client tools)
#<----time service

#---->datetime service start
add_executable(datetimeserver src/datetime.c)
target_link_libraries(datetimeserver tools)

add_executable(datetime_tcp_client src/datetime_tcp_client.c)
target_link_libraries(datetime_tcp_client tools)

add_executable(datetime_udp_client src/datetime_udp_client.c)
target_link_libraries(datetime_udp_client tools)
#<----datetime ends

